var mongoose = require('mongoose');
before(function(d){
  mongoose.connect('mongodb://localhost/test2');
  // var db = mongoose.connection;
  // db.on('error', console.error.bind(console, 'connection error:'));
  // db.once('open', function() {
  //   // we're connected!
  //   console.log('connect made');
  // });
  mongoose.connection.once('open',function(){
    console.log('connect made');
    d();

  }).on('error',function() {
    console.log('connect error');


  })


});

beforeEach(function(d){
  mongoose.connection.collections.mariochars.drop(function(){
    d();
  });
});
